﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using Service.Services.Login;
using Service.Services.Login.Dto;

namespace Web.Controllers
{
    /// <summary>
    /// 用户登录接口
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController,AllowAnonymous]
    public class LoginController(
        LoginService loginService
        ) : ControllerBase
    {
         
        /// <summary>
        /// 用户密码登录
        /// </summary>
        /// <param name="input"></param>
        /// <returns></returns>
        [HttpPost,]
        public async Task<dynamic> LoginByPassWord([FromBody] Login_Input_LoginByPassWord input)
        {
            await Task.Delay(1000);
            await loginService.LoginByPassWord(input);
            return $"{DateTime.Now:F}";
        }
    }
}
